Imports System.Text


Public Class ACCuerpo(Of T)
#Region " Variables "

   Private m_listado As List(Of T)
   Private m_columnas As List(Of ACColumna)
   Private m_cabecera As Boolean
   Private m_filas As Integer

#End Region

#Region " Propiedades "

   Public Property Filas() As String
      Get
         Return m_filas
      End Get
      Set(ByVal value As String)
         m_filas = value
      End Set
   End Property

   Public Property Columnas() As List(Of ACColumna)
      Get
         Return m_columnas
      End Get
      Set(ByVal value As List(Of ACColumna))
         m_columnas = value
      End Set
   End Property

   Public ReadOnly Property Ancho() As Integer
      Get
         If IsNothing(m_columnas) Then
            Dim i As Integer = 0
            For Each Item As ACColumna In m_columnas
               i += Item.Ancho
            Next
            Return i
         Else
            Return 0
         End If
      End Get
   End Property

   Public ReadOnly Property NroColumnas() As Integer
      Get
         If IsNothing(m_columnas) Then
            Return 0
         Else
            Return m_columnas.Count
         End If
      End Get
   End Property

   Public Property ListadoColumnas() As List(Of T)
      Get
         Return m_listado
      End Get
      Set(ByVal value As List(Of T))
         m_listado = value
      End Set
   End Property

   Public Property Cabecera() As Boolean
      Get
         Return m_cabecera
      End Get
      Set(ByVal value As Boolean)
         m_cabecera = value
      End Set
   End Property
#End Region

#Region " Constructores "
   Public Sub New()
      m_cabecera = False
   End Sub

   Public Sub New(ByVal x_cabecera As Boolean)
      m_cabecera = x_cabecera
   End Sub

   Public Sub New(ByVal x_filas As Integer)
      m_filas = x_filas
   End Sub

   Public Sub New(ByVal x_listado As List(Of T), ByVal x_columnas As List(Of ACColumna))
      Try
         m_listado = New List(Of T)(x_listado)
         m_columnas = New List(Of ACColumna)(x_columnas)
      Catch ex As Exception
         Throw ex
      End Try
   End Sub

Public Sub New(ByVal x_listado As List(Of T), ByVal x_columnas As List(Of ACColumna), ByVal x_filas as Integer)
      Try
         m_listado = New List(Of T)(x_listado)
         m_columnas = New List(Of ACColumna)(x_columnas)
         m_filas = x_filas
      Catch ex As Exception
         Throw ex
      End Try
   End Sub

   Public Sub New(ByVal x_listado As List(Of T), ByVal x_columnas() As ACColumna)
      Try
         m_listado = New List(Of T)(x_listado)
         m_columnas = New List(Of ACColumna)()

         m_columnas = New List(Of ACColumna)
         For Each Item As ACColumna In x_columnas
            m_columnas.Add(Item)
         Next

      Catch ex As Exception
         Throw ex
      End Try
   End Sub

   Public Sub New(ByVal x_listado As List(Of T), ByVal x_columnas() As ACColumna, ByVal x_filas as Integer)
      Try
         m_listado = New List(Of T)(x_listado)
         m_columnas = New List(Of ACColumna)()
         m_filas = x_filas
         m_columnas = New List(Of ACColumna)
         For Each Item As ACColumna In x_columnas
            m_columnas.Add(Item)
         Next

      Catch ex As Exception
         Throw ex
      End Try
   End Sub

#End Region

#Region " Metodos "

#End Region
End Class
